package com.woniu.command.handle;

import com.woniu.adapter.OrderAdapter;
import com.woniu.outlet.dao.OrderPoMapper;
import com.woniu.outlet.po.OrderDeliver;
import com.woniu.outlet.po.OrderDetails;
import com.woniu.outlet.po.OrderPo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OrderCommandHandler {
    @Autowired
    private OrderAdapter orderAdapter;

    public Boolean addOrder(OrderPo orderPo){
        boolean b = orderAdapter.addOrder(orderPo);
        return b;
    }

    public Boolean addOrderDetails(OrderDetails orderDetails) {
        boolean b = orderAdapter.addOrderDetails(orderDetails);
        return b;
    }

    public Boolean updateOrder(OrderPo orderPo) {
        Boolean b = orderAdapter.updateOrder(orderPo);
        return b;
    }

    public Boolean deleteOrderByorderNo(String orderNo) {
        Boolean b = orderAdapter.deleteOrderByOrderNo(orderNo);
        return b;
    }

    public Boolean addOrderDeliver(OrderDeliver orderDeliver) {
        boolean b = orderAdapter.addOrderDeliver(orderDeliver);
        return b;
    }

    public Boolean updateOrderDeliver(OrderDeliver orderDeliver) {
        boolean b =  orderAdapter.updateOrderDeliver(orderDeliver);
        return b;
    }

    public Boolean deleteOrderDeliverByOrderNo(String orderNo) {
        boolean b =  orderAdapter.deleteOrderDeliverByOrderNo(orderNo);
        return b;
    }
}
